#include <bits/stdc++.h>
using namespace std;
template <typename Cap, typename Cost> struct primal_dual {
  static constexpr Cost INF = numeric_limits<Cost>::max() >> 1;
  struct edge {
    int to, rev;
    Cap res;
    Cost cost;
  };
  int n, s, t;
  vector<vector<edge>> adj;
  vector<Cost> h;
  vector<pair<int, int>> pa;
  primal_dual(vector<vector<tuple<int, int, int>>> adj0, int s, int t) : n(adj0.size() - 1), s(s), t(t), adj(n + 1), h(n + 1), pa(n + 1) {
    for (int i = 1; i <= n; i ++) {
      for (auto x : adj0[i]) {
        int j = get<0>(x), cap = get<1>(x), cost = get<2>(x);
        adj[i].emplace_back(edge{j, (int)adj[j].size(), cap, cost});
        adj[j].emplace_back(edge{i, (int)adj[i].size() - 1, 0, -cost});
      }
    }
  }
  bool expath() {
    vector<bool> vis(n + 1);
    vector<Cost> dis(n + 1, INF);
    priority_queue<pair<Cost, int>, vector<pair<Cost, int>>, greater<void>> q;
    dis[s] = 0;
    q.emplace(0, s);
    while (!q.empty()) {
      int u = q.top().second;
      q.pop();
      if (u == t) break;
      if (vis[u]) continue;
      vis[u] = 1;
      for (int i = 0; i < adj[u].size(); i ++) {
        auto &e = adj[u][i];
        Cost c = e.cost - h[u] + h[e.to];
        if (e.res > 0 && dis[e.to] > dis[u] + c) {
          pa[e.to] = {u, i};
          dis[e.to] = dis[u] + c;
          q.emplace(dis[e.to], e.to);
        }
      }
    }
    if (dis[t] == INF) return 0;
    for (int i = 1; i <= n; i ++)
      if (vis[i])
        h[i] += dis[t] - dis[i];
    return 1;
  }
  pair<Cap, Cost> min_cost_flow() {
    Cap flow = 0;
    Cost cost = 0;
    while (expath()) {
      Cap f = INF;
      for (int i = t; i != s; i = pa[i].first)
        f = min(f, adj[pa[i].first][pa[i].second].res);
      flow += f;
      cost += f * h[s];
      for (int i = t; i != s; i = pa[i].first) {
        adj[pa[i].first][pa[i].second].res -= f;
        adj[i][adj[pa[i].first][pa[i].second].rev].res += f;
      }
    }
    return {flow, cost};
  }
};
constexpr int MAXN = 305;
int n, m, q;
int main(){
  freopen("journey.in", "r", stdin);
  freopen("journey.out", "w", stdout);
  cin.tie(nullptr)->sync_with_stdio(false);
  cin >> n >> m >> q;
  vector<vector<tuple<int, int, int>>> E(2 * n + 3);
  while(m--){
    int x, y, z; cin >> x >> y >> z, E[x].emplace_back(y + n, n, z);
  }
  for(int i = 1; i <= n; i++){
    E[2 * n + 1].emplace_back(i, 1, 0), E[2 * n + 1].emplace_back(i + n, 1, 0);
    E[i + n].emplace_back(i, n, 0), E[i + n].emplace_back(2 * n + 2, 1, 0);
  }
  while(q--){
    int c; cin >> c;
    for(auto &e: E[2 * n + 1]) if(get<0>(e) > n) get<2>(e) = c;
    cout << primal_dual<int, int>(E, 2 * n + 1, 2 * n + 2).min_cost_flow().second << '\n';
  }
  cerr << (double)clock() / CLOCKS_PER_SEC << endl;
  return 0;
}
